import numStatus from "./numStatus"

const defaultState = {
  ...numStatus.state
}
let reduce = (state = defaultState, action: { type: string, val: number }) => {
  let newState = JSON.parse(JSON.stringify(state))

  switch (action.type) {
    case numStatus.add:
      return numStatus.actions[numStatus.add](newState, action)
  }
  return newState
}

export default reduce